Load Data

library(gdata)
dataset <- read.delim("raw_data/Figure3C.txt", stringsAsFactors = FALSE)

dataset$genotype <- factor(gsub(" ","",dataset$genotype))
dataset$experiment <- factor(rep(paste0("exp", 1:(length(dataset$genotype)/length(levels(dataset$genotype)))), each= length(levels(dataset$genotype))))

dataset$UID <- factor(paste(dataset$experiment, dataset$genotype))

kable(dataset, row.names = F)
genotype NT X2h X4h X6h experiment UID
WT 6.900000 35.40000 26.33333 22.93333 exp1 exp1 WT
PARP1KO 7.000000 57.90000 43.13333 31.96667 exp1 exp1 PARP1KO
ALC1KO 7.033333 56.46667 43.33333 33.20000 exp1 exp1 ALC1KO
ALC1KOPARP1KO 7.733333 57.40000 44.60000 34.00000 exp1 exp1 ALC1KOPARP1KO
WT 6.966667 35.70000 25.53333 23.56667 exp2 exp2 WT
PARP1KO 6.866667 55.73333 44.36667 38.70000 exp2 exp2 PARP1KO
ALC1KO 6.466667 54.56667 42.23333 32.76667 exp2 exp2 ALC1KO
ALC1KOPARP1KO 7.000000 55.40000 49.50000 32.86667 exp2 exp2 ALC1KOPARP1KO
WT 7.600000 37.13333 32.93333 23.03333 exp3 exp3 WT
PARP1KO 8.033333 52.70000 35.03333 31.60000 exp3 exp3 PARP1KO
ALC1KO 7.800000 52.33333 34.03333 33.30000 exp3 exp3 ALC1KO
ALC1KOPARP1KO 7.500000 52.26667 34.00000 34.70000 exp3 exp3 ALC1KOPARP1KO
library(reshape2)
# reshape to long format
dataset <- melt(dataset, variable.name = "treatment", value.name = "Outcome")

dataset$genotype <- relevel(dataset$genotype, ref = "WT")
dataset$UID <- relevel(dataset$UID, ref = "exp1 WT")

dataset$time <- gsub("NT","0",dataset$treatment)
dataset$time <- gsub("X|h","",dataset$time)
dataset$time <- as.integer(dataset$time)



kable(dataset, row.names = F)
genotype experiment UID treatment Outcome time
WT exp1 exp1 WT NT 6.900000 0
PARP1KO exp1 exp1 PARP1KO NT 7.000000 0
ALC1KO exp1 exp1 ALC1KO NT 7.033333 0
ALC1KOPARP1KO exp1 exp1 ALC1KOPARP1KO NT 7.733333 0
WT exp2 exp2 WT NT 6.966667 0
PARP1KO exp2 exp2 PARP1KO NT 6.866667 0
ALC1KO exp2 exp2 ALC1KO NT 6.466667 0
ALC1KOPARP1KO exp2 exp2 ALC1KOPARP1KO NT 7.000000 0
WT exp3 exp3 WT NT 7.600000 0
PARP1KO exp3 exp3 PARP1KO NT 8.033333 0
ALC1KO exp3 exp3 ALC1KO NT 7.800000 0
ALC1KOPARP1KO exp3 exp3 ALC1KOPARP1KO NT 7.500000 0
WT exp1 exp1 WT X2h 35.400000 2
PARP1KO exp1 exp1 PARP1KO X2h 57.900000 2
ALC1KO exp1 exp1 ALC1KO X2h 56.466667 2
ALC1KOPARP1KO exp1 exp1 ALC1KOPARP1KO X2h 57.400000 2
WT exp2 exp2 WT X2h 35.700000 2
PARP1KO exp2 exp2 PARP1KO X2h 55.733333 2
ALC1KO exp2 exp2 ALC1KO X2h 54.566667 2
ALC1KOPARP1KO exp2 exp2 ALC1KOPARP1KO X2h 55.400000 2
WT exp3 exp3 WT X2h 37.133333 2
PARP1KO exp3 exp3 PARP1KO X2h 52.700000 2
ALC1KO exp3 exp3 ALC1KO X2h 52.333333 2
ALC1KOPARP1KO exp3 exp3 ALC1KOPARP1KO X2h 52.266667 2
WT exp1 exp1 WT X4h 26.333333 4
PARP1KO exp1 exp1 PARP1KO X4h 43.133333 4
ALC1KO exp1 exp1 ALC1KO X4h 43.333333 4
ALC1KOPARP1KO exp1 exp1 ALC1KOPARP1KO X4h 44.600000 4
WT exp2 exp2 WT X4h 25.533333 4
PARP1KO exp2 exp2 PARP1KO X4h 44.366667 4
ALC1KO exp2 exp2 ALC1KO X4h 42.233333 4
ALC1KOPARP1KO exp2 exp2 ALC1KOPARP1KO X4h 49.500000 4
WT exp3 exp3 WT X4h 32.933333 4
PARP1KO exp3 exp3 PARP1KO X4h 35.033333 4
ALC1KO exp3 exp3 ALC1KO X4h 34.033333 4
ALC1KOPARP1KO exp3 exp3 ALC1KOPARP1KO X4h 34.000000 4
WT exp1 exp1 WT X6h 22.933333 6
PARP1KO exp1 exp1 PARP1KO X6h 31.966667 6
ALC1KO exp1 exp1 ALC1KO X6h 33.200000 6
ALC1KOPARP1KO exp1 exp1 ALC1KOPARP1KO X6h 34.000000 6
WT exp2 exp2 WT X6h 23.566667 6
PARP1KO exp2 exp2 PARP1KO X6h 38.700000 6
ALC1KO exp2 exp2 ALC1KO X6h 32.766667 6
ALC1KOPARP1KO exp2 exp2 ALC1KOPARP1KO X6h 32.866667 6
WT exp3 exp3 WT X6h 23.033333 6
PARP1KO exp3 exp3 PARP1KO X6h 31.600000 6
ALC1KO exp3 exp3 ALC1KO X6h 33.300000 6
ALC1KOPARP1KO exp3 exp3 ALC1KOPARP1KO X6h 34.700000 6

Plot Data

library(ggplot2)

# quadratic
ggplot(dataset, aes(x=time, y=Outcome)) + 
        theme_bw() +
        theme(panel.grid=element_blank(), text = element_text(size=14)) +
        geom_smooth(method=lm, formula = y ~ poly(x,2), se=FALSE, aes(colour=genotype)) +
        geom_point(aes(colour=genotype, shape=experiment), size=2) +        
        facet_grid(. ~ genotype) +
        xlab(label = "Time post 2 Gy irradiation") +
        scale_shape_manual(values=15:20) +
        scale_color_manual(values=c("#000000","#000080","#808080","#800000"))

# cubic
ggplot(dataset, aes(x=time, y=Outcome)) + 
        theme_bw() +
        theme(panel.grid=element_blank(), text = element_text(size=14)) +
        geom_smooth(method=lm, formula = y ~ poly(x,3), se=FALSE, aes(colour=genotype)) +
        geom_point(aes(colour=genotype, shape=experiment), size=2) +        
        facet_grid(. ~ genotype) +
        xlab(label = "Time post 2 Gy irradiation") +
        scale_shape_manual(values=15:20) +
        scale_color_manual(values=c("#000000","#000080","#808080","#800000"))

dataplot <- aggregate(Outcome ~ genotype+treatment, data = dataset, mean)
dataplot$se <- aggregate(Outcome ~ genotype+treatment, data = dataset, FUN = function(x){ sd(x)/sqrt(length(x))})$Outcome
dataplot$treatment <- factor(gsub("X|.nM","", dataplot$treatment)) 

dataplot$genotype <- factor(dataplot$genotype, levels = c("WT","PARP1KO","ALC1KO","ALC1KOPARP1KO"))
dataplot$treatment <- relevel(dataplot$treatment, ref = "NT")


ggplot(dataplot, aes(x=treatment, y=Outcome, fill = genotype)) + 
        theme_bw() +
        theme(panel.grid=element_blank(), text = element_text(size=14)) +
        geom_bar(stat="identity", position=position_dodge()) +
        geom_errorbar(aes(ymin=Outcome-se, ymax=Outcome+se),width=.2, position=position_dodge(.9)) +
        ylab(label = paste0(expression("\u03B3"),"H2AX foci per cell")) +
        xlab(label = "Time post 2 Gy irradiation") +
        ylim(0, 70) +
        scale_fill_manual(values=c("#000000","#800000","#000080","#808080"))

library(Cairo)

cairo_pdf("Figure3C_v1.pdf", width = 7, height = 4, family = "Arial")

ggplot(dataplot, aes(x=treatment, y=Outcome, fill = genotype)) + 
        theme_bw() +
        theme(panel.grid.major=element_blank(), panel.grid.minor=element_blank(), 
              axis.line = element_line(colour = "black"), text = element_text(size=14),
              panel.border = element_blank(), panel.background = element_blank()) +
        geom_bar(stat="identity", position=position_dodge()) +
        geom_errorbar(aes(ymin=Outcome-se, ymax=Outcome+se),width=.2, position=position_dodge(.9)) +
        ylab(label = paste0(expression("\u03B3"),"H2AX foci per cell")) +
        xlab(label = "Time post 2 Gy irradiation (h)") +
        ylim(0, 70) +
        scale_fill_manual(values=c("#000000","#800000","#000080","#808080"))

dev.off()
## quartz_off_screen 
##                 2
dataset$genotype <- factor(dataset$genotype, levels = c("WT","PARP1KO","ALC1KO","ALC1KOPARP1KO"))
dataset$treatment <- factor(gsub("X","", dataset$treatment)) 
dataset$treatment <- relevel(dataset$treatment, ref = "NT")

cairo_pdf("Figure3C_v2.pdf", width = 7, height = 4, family = "Arial")

ggplot(dataplot, aes(x=treatment, y=Outcome, fill = genotype)) + 
        theme_bw() +
        theme(panel.grid.major=element_blank(), panel.grid.minor=element_blank(), 
              axis.line = element_line(colour = "black"), text = element_text(size=14),
              panel.border = element_blank(), panel.background = element_blank()) +
        geom_bar(stat="identity", position=position_dodge(), colour="black") +
        ylab(label = paste0(expression("\u03B3"),"H2AX foci per cell")) +
        xlab(label = "Time post 2 Gy irradiation (h)") +
        ylim(0, 70) +
        scale_fill_manual(values=c("#00000080","#80000080","#00008080","#80808080")) +
        geom_jitter(data = dataset, cex=1, position=position_dodge(0.9),  aes(colour=genotype)) +
        scale_color_manual(values=c("#000000","#800000","#000080","#808080")) +
        geom_errorbar(aes(ymin=Outcome-se, ymax=Outcome+se),width=.2, position=position_dodge(.9)) 

cairo_pdf("Figure3C_v3.pdf", width = 7, height = 4, family = "Arial")

ggplot(dataset, aes(x=treatment, y=Outcome, color=genotype)) +
        theme_bw() +
        theme(panel.grid.major=element_blank(), panel.grid.minor=element_blank(), 
              axis.line = element_line(colour = "black"), text = element_text(size=14),
              panel.border = element_blank(), panel.background = element_blank()) +
        geom_jitter(cex=1, position=position_dodge(1)) +
        stat_summary(fun.data=mean_se, fun.args = list(mult=1), geom="errorbar", width=0.25, aes(colour=genotype), position=position_dodge(1)) +
        stat_summary(fun.y=mean, geom="crossbar", width=0.5, aes(colour=genotype), position=position_dodge(1)) +
        ylab(label = paste0(expression("\u03B3"),"H2AX foci per cell")) +
        xlab(label = "Time post 2 Gy irradiation (h)") +
        ylim(0, 70) +
        scale_fill_manual(values=c("#00000080","#80000080","#00008080","#80808080")) +
        scale_color_manual(values=c("#000000","#800000","#000080","#808080"))


dev.off()
## quartz_off_screen 
##                 2

Linear Model

library(MASS)
library(DHARMa)
library(lme4)
library(lmerTest)
library(bbmle)
fit1 <- lm(Outcome ~ experiment+time*genotype, data = dataset)
print(summary(fit1))
## 
## Call:
## lm(formula = Outcome ~ experiment + time * genotype, data = dataset)
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
## -18.47 -11.40  -4.02  11.26  26.18 
## 
## Coefficients:
##                            Estimate Std. Error t value Pr(>|t|)  
## (Intercept)                 18.2235     8.6422   2.109   0.0416 *
## experimentexp2               0.1813     5.8266   0.031   0.9753  
## experimentexp3              -1.9583     5.8266  -0.336   0.7386  
## time                         2.0128     2.1276   0.946   0.3501  
## genotypePARP1KO              6.9233    11.2580   0.615   0.5422  
## genotypeALC1KO               6.4900    11.2580   0.576   0.5677  
## genotypeALC1KOPARP1KO        7.0644    11.2580   0.628   0.5341  
## time:genotypePARP1KO         1.2756     3.0088   0.424   0.6740  
## time:genotypeALC1KO          1.1561     3.0088   0.384   0.7029  
## time:genotypeALC1KOPARP1KO   1.3378     3.0088   0.445   0.6591  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 16.48 on 38 degrees of freedom
## Multiple R-squared:  0.2384, Adjusted R-squared:  0.05807 
## F-statistic: 1.322 on 9 and 38 DF,  p-value: 0.2582
cat("AIC: ", AIC(fit1))
## AIC:  416.0109
simres <- simulateResiduals(fittedModel = fit1)
plot(simres)

fit2 <- lm(Outcome ~ experiment+poly(time,2)*genotype, data = dataset)
print(summary(fit2))
## 
## Call:
## lm(formula = Outcome ~ experiment + poly(time, 2) * genotype, 
##     data = dataset)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -16.8457  -4.5005   0.4646   5.1439  12.4515 
## 
## Coefficients:
##                                      Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                           24.2618     3.0942   7.841 3.97e-09 ***
## experimentexp2                         0.1813     3.0942   0.059  0.95363    
## experimentexp3                        -1.9583     3.0942  -0.633  0.53103    
## poly(time, 2)1                        31.1818    17.5035   1.781  0.08377 .  
## poly(time, 2)2                       -58.9090    17.5035  -3.366  0.00191 ** 
## genotypePARP1KO                       10.7500     3.5729   3.009  0.00491 ** 
## genotypeALC1KO                         9.9583     3.5729   2.787  0.00864 ** 
## genotypeALC1KOPARP1KO                 11.0778     3.5729   3.101  0.00387 ** 
## poly(time, 2)1:genotypePARP1KO        19.7608    24.7537   0.798  0.43024    
## poly(time, 2)2:genotypePARP1KO       -36.1806    24.7537  -1.462  0.15303    
## poly(time, 2)1:genotypeALC1KO         17.9104    24.7537   0.724  0.47429    
## poly(time, 2)2:genotypeALC1KO        -34.8527    24.7537  -1.408  0.16821    
## poly(time, 2)1:genotypeALC1KOPARP1KO  20.7248    24.7537   0.837  0.40830    
## poly(time, 2)2:genotypeALC1KOPARP1KO -38.8749    24.7537  -1.570  0.12557    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 8.752 on 34 degrees of freedom
## Multiple R-squared:  0.8078, Adjusted R-squared:  0.7344 
## F-statistic: 10.99 on 13 and 34 DF,  p-value: 1.158e-08
cat("AIC: ", AIC(fit2))
## AIC:  357.914
simres <- simulateResiduals(fittedModel = fit2)
plot(simres)

fit3 <- lm(Outcome ~ experiment+poly(time,3)*genotype, data = dataset)
print(summary(fit3))
## 
## Call:
## lm(formula = Outcome ~ experiment + poly(time, 3) * genotype, 
##     data = dataset)
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
## -7.334 -1.190 -0.483  1.719  6.033 
## 
## Coefficients:
##                                      Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                           24.2618     1.0996  22.063  < 2e-16 ***
## experimentexp2                         0.1813     1.0996   0.165 0.870186    
## experimentexp3                        -1.9583     1.0996  -1.781 0.085061 .  
## poly(time, 3)1                        31.1818     6.2205   5.013 2.25e-05 ***
## poly(time, 3)2                       -58.9090     6.2205  -9.470 1.60e-10 ***
## poly(time, 3)3                        30.5621     6.2205   4.913 2.98e-05 ***
## genotypePARP1KO                       10.7500     1.2698   8.466 1.90e-09 ***
## genotypeALC1KO                         9.9583     1.2698   7.843 9.43e-09 ***
## genotypeALC1KOPARP1KO                 11.0778     1.2698   8.724 9.93e-10 ***
## poly(time, 3)1:genotypePARP1KO        19.7608     8.7971   2.246 0.032203 *  
## poly(time, 3)2:genotypePARP1KO       -36.1806     8.7971  -4.113 0.000280 ***
## poly(time, 3)3:genotypePARP1KO        24.1158     8.7971   2.741 0.010213 *  
## poly(time, 3)1:genotypeALC1KO         17.9104     8.7971   2.036 0.050671 .  
## poly(time, 3)2:genotypeALC1KO        -34.8527     8.7971  -3.962 0.000424 ***
## poly(time, 3)3:genotypeALC1KO         23.4703     8.7971   2.668 0.012187 *  
## poly(time, 3)1:genotypeALC1KOPARP1KO  20.7248     8.7971   2.356 0.025210 *  
## poly(time, 3)2:genotypeALC1KOPARP1KO -38.8749     8.7971  -4.419 0.000119 ***
## poly(time, 3)3:genotypeALC1KOPARP1KO  18.5559     8.7971   2.109 0.043371 *  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 3.11 on 30 degrees of freedom
## Multiple R-squared:  0.9786, Adjusted R-squared:  0.9664 
## F-statistic: 80.64 on 17 and 30 DF,  p-value: < 2.2e-16
cat("AIC: ", AIC(fit3))
## AIC:  260.5896
simres <- simulateResiduals(fittedModel = fit3)
plot(simres)

Compare Results

ICtab(fit1,fit2,fit3,
      base=T)
##      AIC   dAIC  df
## fit3 260.6   0.0 19
## fit2 357.9  97.3 15
## fit1 416.0 155.4 11

Final Result

fit <- fit3

output <- coef(summary(fit))
output <- output[grep("time", rownames(output)),]

rownames(output) <- gsub("poly\\(|, [1-3]\\)","", rownames(output) )
rownames(output) <- gsub("genotype",  paste0(" ",levels(dataset$genotype)[1], " vs. "), rownames(output))
rownames(output)[!(grepl("vs", rownames(output)))] <- paste(rownames(output)[!(grepl("vs", rownames(output)))], levels(dataset$genotype)[1],  sep = " in " )


# suggested result table
kable(output, row.names = T)
Estimate Std. Error t value Pr(>|t|)
time1 in WT 31.18182 6.220513 5.012741 0.0000225
time2 in WT -58.90897 6.220513 -9.470115 0.0000000
time3 in WT 30.56214 6.220513 4.913122 0.0000298
time1: WT vs. PARP1KO 19.76082 8.797134 2.246279 0.0322029
time2: WT vs. PARP1KO -36.18062 8.797134 -4.112773 0.0002798
time3: WT vs. PARP1KO 24.11578 8.797134 2.741322 0.0102126
time1: WT vs. ALC1KO 17.91040 8.797134 2.035935 0.0506706
time2: WT vs. ALC1KO -34.85271 8.797134 -3.961826 0.0004240
time3: WT vs. ALC1KO 23.47028 8.797134 2.667946 0.0121872
time1: WT vs. ALC1KOPARP1KO 20.72476 8.797134 2.355854 0.0252105
time2: WT vs. ALC1KOPARP1KO -38.87492 8.797134 -4.419043 0.0001194
time3: WT vs. ALC1KOPARP1KO 18.55589 8.797134 2.109311 0.0433710
write.table(output, file = "Figure3C_Stats_Ref_WT.txt", quote = F, sep = "\t", row.names = T, col.names = NA)
# re-fit with ALC1KO reference
dataset$genotype <- relevel(dataset$genotype, ref = "ALC1KO")

fit <- lm(Outcome ~ experiment+poly(time,3)*genotype, data = dataset)

output <- coef(summary(fit))
output <- output[grep("time", rownames(output)),]

rownames(output) <- gsub("poly\\(|, [1-3]\\)","", rownames(output) )
rownames(output) <- gsub("genotype",  paste0(" ",levels(dataset$genotype)[1], " vs. "), rownames(output))
rownames(output)[!(grepl("vs", rownames(output)))] <- paste(rownames(output)[!(grepl("vs", rownames(output)))], levels(dataset$genotype)[1],  sep = " in " )


# suggested result table
kable(output, row.names = T)
Estimate Std. Error t value Pr(>|t|)
time1 in ALC1KO 49.0922156 6.220513 7.8919881 0.0000000
time2 in ALC1KO -93.7616837 6.220513 -15.0729821 0.0000000
time3 in ALC1KO 54.0324210 6.220513 8.6861678 0.0000000
time1: ALC1KO vs. WT -17.9103963 8.797134 -2.0359354 0.0506706
time2: ALC1KO vs. WT 34.8527113 8.797134 3.9618256 0.0004240
time3: ALC1KO vs. WT -23.4702791 8.797134 -2.6679460 0.0121872
time1: ALC1KO vs. PARP1KO 1.8504254 8.797134 0.2103441 0.8348212
time2: ALC1KO vs. PARP1KO -1.3279056 8.797134 -0.1509475 0.8810275
time3: ALC1KO vs. PARP1KO 0.6454972 8.797134 0.0733759 0.9419941
time1: ALC1KO vs. ALC1KOPARP1KO 2.8143679 8.797134 0.3199187 0.7512474
time2: ALC1KO vs. ALC1KOPARP1KO -4.0222069 8.797134 -0.4572179 0.6508083
time3: ALC1KO vs. ALC1KOPARP1KO -4.9143855 8.797134 -0.5586348 0.5805571
write.table(output, file = "Figure3C_Stats_Ref_ALC1KO.txt", quote = F, sep = "\t", row.names = T, col.names = NA)

ANOVA

fit3a <- lm(Outcome ~ experiment+poly(time,3)*genotype, data = dataset)
fit3b <- lm(Outcome ~ experiment+poly(time,3)+genotype, data = dataset)

anova(fit3a, fit3b)
## Analysis of Variance Table
## 
## Model 1: Outcome ~ experiment + poly(time, 3) * genotype
## Model 2: Outcome ~ experiment + poly(time, 3) + genotype
##   Res.Df    RSS Df Sum of Sq      F    Pr(>F)    
## 1     30 290.21                                  
## 2     39 711.80 -9   -421.59 4.8424 0.0004862 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

New analysis

dataset$genotype <- relevel(dataset$genotype, ref = "WT")


for(i in 2:length(levels(dataset$treatment))){
        
        dataset_sub <- dataset[dataset$treatment == levels(dataset$treatment)[i],]
        
        for(g in seq_along(levels(dataset_sub$genotype))){
                
                
                cat("Time: ", levels(dataset$treatment)[i], "\n",
                    "Genotype: ", levels(dataset$genotype)[g], "\n")
                
                
                dataset_sub$genotype <- relevel(dataset_sub$genotype, ref = levels(dataset_sub$genotype)[g])

                fit_sub <- lm(Outcome ~ genotype, data = dataset_sub)
                
                print(summary(fit_sub))
                cat("AIC: ", AIC(fit_sub))
                
                
                simres <- simulateResiduals(fittedModel = fit_sub)
                plot(simres)
                
                if(i == 2 & g == 1){
                        output <- coef(summary(fit_sub))
                        output <- output[grep("genotype", rownames(output)),]
                        rownames(output) <- paste0(gsub("genotype",  paste0(" ",levels(dataset$genotype)[g], " vs. "), rownames(output)),
                                                   " in Time ", levels(dataset$treatment)[i])
                } else {
                        outtmp <- coef(summary(fit_sub))
                        outtmp <- outtmp[grep("genotype", rownames(outtmp)),]
                        rownames(outtmp) <- paste0(gsub("genotype",  paste0(" ",levels(dataset$genotype)[g], " vs. "), rownames(outtmp)),
                                                   " in Time ", levels(dataset$treatment)[i])
                        
                        output <- rbind(output,outtmp)
                        
                        if(g == length(levels(dataset_sub$genotype)) & i < length(levels(dataset$treatment))){
                                
                                output <- rbind(output, " ", colnames(output))
                        }
                }
                
        }
        
        
}
## Time:  2h 
##  Genotype:  WT 
## 
## Call:
## lm(formula = Outcome ~ genotype, data = dataset_sub)
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
## -2.756 -1.039  0.200  1.294  2.456 
## 
## Coefficients:
##                       Estimate Std. Error t value Pr(>|t|)    
## (Intercept)             36.078      1.247   28.93 2.20e-09 ***
## genotypeALC1KO          18.378      1.763   10.42 6.23e-06 ***
## genotypePARP1KO         19.367      1.763   10.98 4.20e-06 ***
## genotypeALC1KOPARP1KO   18.944      1.763   10.74 4.96e-06 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 2.16 on 8 degrees of freedom
## Multiple R-squared:  0.9557, Adjusted R-squared:  0.9391 
## F-statistic: 57.52 on 3 and 8 DF,  p-value: 9.311e-06
## 
## AIC:  57.66738

## Time:  2h 
##  Genotype:  ALC1KO 
## 
## Call:
## lm(formula = Outcome ~ genotype, data = dataset_sub)
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
## -2.756 -1.039  0.200  1.294  2.456 
## 
## Coefficients:
##                       Estimate Std. Error t value Pr(>|t|)    
## (Intercept)            54.4556     1.2469  43.674 8.33e-11 ***
## genotypeWT            -18.3778     1.7633 -10.422 6.23e-06 ***
## genotypePARP1KO         0.9889     1.7633   0.561    0.590    
## genotypeALC1KOPARP1KO   0.5667     1.7633   0.321    0.756    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 2.16 on 8 degrees of freedom
## Multiple R-squared:  0.9557, Adjusted R-squared:  0.9391 
## F-statistic: 57.52 on 3 and 8 DF,  p-value: 9.311e-06
## 
## AIC:  57.66738

## Time:  2h 
##  Genotype:  PARP1KO 
## 
## Call:
## lm(formula = Outcome ~ genotype, data = dataset_sub)
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
## -2.756 -1.039  0.200  1.294  2.456 
## 
## Coefficients:
##                       Estimate Std. Error t value Pr(>|t|)    
## (Intercept)            55.4444     1.2469  44.467 7.22e-11 ***
## genotypeALC1KO         -0.9889     1.7633  -0.561    0.590    
## genotypeWT            -19.3667     1.7633 -10.983 4.20e-06 ***
## genotypeALC1KOPARP1KO  -0.4222     1.7633  -0.239    0.817    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 2.16 on 8 degrees of freedom
## Multiple R-squared:  0.9557, Adjusted R-squared:  0.9391 
## F-statistic: 57.52 on 3 and 8 DF,  p-value: 9.311e-06
## 
## AIC:  57.66738

## Time:  2h 
##  Genotype:  ALC1KOPARP1KO 
## 
## Call:
## lm(formula = Outcome ~ genotype, data = dataset_sub)
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
## -2.756 -1.039  0.200  1.294  2.456 
## 
## Coefficients:
##                 Estimate Std. Error t value Pr(>|t|)    
## (Intercept)      55.0222     1.2469  44.129 7.67e-11 ***
## genotypePARP1KO   0.4222     1.7633   0.239    0.817    
## genotypeALC1KO   -0.5667     1.7633  -0.321    0.756    
## genotypeWT      -18.9444     1.7633 -10.744 4.96e-06 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 2.16 on 8 degrees of freedom
## Multiple R-squared:  0.9557, Adjusted R-squared:  0.9391 
## F-statistic: 57.52 on 3 and 8 DF,  p-value: 9.311e-06
## 
## AIC:  57.66738

## Time:  4h 
##  Genotype:  WT 
## 
## Call:
## lm(formula = Outcome ~ genotype, data = dataset_sub)
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
## -8.700 -3.503  2.094  3.481  6.800 
## 
## Coefficients:
##                       Estimate Std. Error t value Pr(>|t|)    
## (Intercept)             28.267      3.301   8.562 2.67e-05 ***
## genotypeALC1KO          11.600      4.669   2.485   0.0378 *  
## genotypePARP1KO         12.578      4.669   2.694   0.0273 *  
## genotypeALC1KOPARP1KO   14.433      4.669   3.091   0.0149 *  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 5.718 on 8 degrees of freedom
## Multiple R-squared:  0.5955, Adjusted R-squared:  0.4438 
## F-statistic: 3.926 on 3 and 8 DF,  p-value: 0.05411
## 
## AIC:  81.03687

## Time:  4h 
##  Genotype:  ALC1KO 
## 
## Call:
## lm(formula = Outcome ~ genotype, data = dataset_sub)
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
## -8.700 -3.503  2.094  3.481  6.800 
## 
## Coefficients:
##                       Estimate Std. Error t value Pr(>|t|)    
## (Intercept)            39.8667     3.3014  12.076 2.04e-06 ***
## genotypeWT            -11.6000     4.6689  -2.485   0.0378 *  
## genotypePARP1KO         0.9778     4.6689   0.209   0.8394    
## genotypeALC1KOPARP1KO   2.8333     4.6689   0.607   0.5608    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 5.718 on 8 degrees of freedom
## Multiple R-squared:  0.5955, Adjusted R-squared:  0.4438 
## F-statistic: 3.926 on 3 and 8 DF,  p-value: 0.05411
## 
## AIC:  81.03687

## Time:  4h 
##  Genotype:  PARP1KO 
## 
## Call:
## lm(formula = Outcome ~ genotype, data = dataset_sub)
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
## -8.700 -3.503  2.094  3.481  6.800 
## 
## Coefficients:
##                       Estimate Std. Error t value Pr(>|t|)    
## (Intercept)            40.8444     3.3014  12.372  1.7e-06 ***
## genotypeALC1KO         -0.9778     4.6689  -0.209   0.8394    
## genotypeWT            -12.5778     4.6689  -2.694   0.0273 *  
## genotypeALC1KOPARP1KO   1.8556     4.6689   0.397   0.7014    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 5.718 on 8 degrees of freedom
## Multiple R-squared:  0.5955, Adjusted R-squared:  0.4438 
## F-statistic: 3.926 on 3 and 8 DF,  p-value: 0.05411
## 
## AIC:  81.03687

## Time:  4h 
##  Genotype:  ALC1KOPARP1KO 
## 
## Call:
## lm(formula = Outcome ~ genotype, data = dataset_sub)
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
## -8.700 -3.503  2.094  3.481  6.800 
## 
## Coefficients:
##                 Estimate Std. Error t value Pr(>|t|)    
## (Intercept)       42.700      3.301  12.934 1.21e-06 ***
## genotypePARP1KO   -1.856      4.669  -0.397   0.7014    
## genotypeALC1KO    -2.833      4.669  -0.607   0.5608    
## genotypeWT       -14.433      4.669  -3.091   0.0149 *  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 5.718 on 8 degrees of freedom
## Multiple R-squared:  0.5955, Adjusted R-squared:  0.4438 
## F-statistic: 3.926 on 3 and 8 DF,  p-value: 0.05411
## 
## AIC:  81.03687

## Time:  6h 
##  Genotype:  WT 
## 
## Call:
## lm(formula = Outcome ~ genotype, data = dataset_sub)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -2.4889 -0.4889 -0.0167  0.2556  4.6111 
## 
## Coefficients:
##                       Estimate Std. Error t value Pr(>|t|)    
## (Intercept)             23.178      1.191  19.455 5.06e-08 ***
## genotypeALC1KO           9.911      1.685   5.882 0.000369 ***
## genotypePARP1KO         10.911      1.685   6.476 0.000193 ***
## genotypeALC1KOPARP1KO   10.678      1.685   6.337 0.000224 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 2.064 on 8 degrees of freedom
## Multiple R-squared:   0.88,  Adjusted R-squared:  0.8349 
## F-statistic: 19.55 on 3 and 8 DF,  p-value: 0.0004859
## 
## AIC:  56.57496

## Time:  6h 
##  Genotype:  ALC1KO 
## 
## Call:
## lm(formula = Outcome ~ genotype, data = dataset_sub)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -2.4889 -0.4889 -0.0167  0.2556  4.6111 
## 
## Coefficients:
##                       Estimate Std. Error t value Pr(>|t|)    
## (Intercept)            33.0889     1.1914  27.774 3.05e-09 ***
## genotypeWT             -9.9111     1.6849  -5.882 0.000369 ***
## genotypePARP1KO         1.0000     1.6849   0.594 0.569230    
## genotypeALC1KOPARP1KO   0.7667     1.6849   0.455 0.661181    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 2.064 on 8 degrees of freedom
## Multiple R-squared:   0.88,  Adjusted R-squared:  0.8349 
## F-statistic: 19.55 on 3 and 8 DF,  p-value: 0.0004859
## 
## AIC:  56.57496

## Time:  6h 
##  Genotype:  PARP1KO 
## 
## Call:
## lm(formula = Outcome ~ genotype, data = dataset_sub)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -2.4889 -0.4889 -0.0167  0.2556  4.6111 
## 
## Coefficients:
##                       Estimate Std. Error t value Pr(>|t|)    
## (Intercept)            34.0889     1.1914  28.613 2.41e-09 ***
## genotypeALC1KO         -1.0000     1.6849  -0.594 0.569230    
## genotypeWT            -10.9111     1.6849  -6.476 0.000193 ***
## genotypeALC1KOPARP1KO  -0.2333     1.6849  -0.138 0.893277    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 2.064 on 8 degrees of freedom
## Multiple R-squared:   0.88,  Adjusted R-squared:  0.8349 
## F-statistic: 19.55 on 3 and 8 DF,  p-value: 0.0004859
## 
## AIC:  56.57496

## Time:  6h 
##  Genotype:  ALC1KOPARP1KO 
## 
## Call:
## lm(formula = Outcome ~ genotype, data = dataset_sub)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -2.4889 -0.4889 -0.0167  0.2556  4.6111 
## 
## Coefficients:
##                 Estimate Std. Error t value Pr(>|t|)    
## (Intercept)      33.8556     1.1914  28.417 2.54e-09 ***
## genotypePARP1KO   0.2333     1.6849   0.138 0.893277    
## genotypeALC1KO   -0.7667     1.6849  -0.455 0.661181    
## genotypeWT      -10.6778     1.6849  -6.337 0.000224 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 2.064 on 8 degrees of freedom
## Multiple R-squared:   0.88,  Adjusted R-squared:  0.8349 
## F-statistic: 19.55 on 3 and 8 DF,  p-value: 0.0004859
## 
## AIC:  56.57496

# suggested result table
kable(output, row.names = T)
Estimate Std. Error t value Pr(>|t|)
WT vs. ALC1KO in Time 2h 18.37777778 1.7633266820798 10.4222195278777 6.2282341210475e-06
WT vs. PARP1KO in Time 2h 19.3666666666667 1.7633266820798 10.9830281952202 4.19750900736835e-06
WT vs. ALC1KOPARP1KO in Time 2h 18.9444444466667 1.7633266820798 10.7435817986501 4.95671792568185e-06
ALC1KO vs. WT in Time 2h -18.37777778 1.7633266820798 -10.4222195278778 6.22823412104745e-06
ALC1KO vs. PARP1KO in Time 2h 0.988888886666668 1.7633266820798 0.560808667342512 0.590284968060016
ALC1KO vs. ALC1KOPARP1KO in Time 2h 0.566666666666665 1.7633266820798 0.321362270772365 0.756171250007262
PARP1KO vs. ALC1KO in Time 2h -0.98888888666667 1.7633266820798 -0.560808667342513 0.590284968060015
PARP1KO vs. WT in Time 2h -19.3666666666667 1.7633266820798 -10.9830281952203 4.19750900736831e-06
PARP1KO vs. ALC1KOPARP1KO in Time 2h -0.422222220000003 1.7633266820798 -0.239446396570147 0.816780149801298
ALC1KOPARP1KO vs. PARP1KO in Time 2h 0.422222220000008 1.7633266820798 0.23944639657015 0.816780149801296
ALC1KOPARP1KO vs. ALC1KO in Time 2h -0.566666666666663 1.7633266820798 -0.321362270772363 0.756171250007263
ALC1KOPARP1KO vs. WT in Time 2h -18.9444444466667 1.7633266820798 -10.7435817986501 4.95671792568182e-06
Estimate Std. Error t value Pr(>|t|)
WT vs. ALC1KO in Time 4h 11.6 4.66893463449613 2.48450683252109 0.037844861183242
WT vs. PARP1KO in Time 4h 12.57777778 4.66893463449613 2.69392886485706 0.0273297999954633
WT vs. ALC1KOPARP1KO in Time 4h 14.4333333366667 4.66893463449613 3.09135476646575 0.0148590262158682
ALC1KO vs. WT in Time 4h -11.6 4.66893463449613 -2.48450683252109 0.0378448611832418
ALC1KO vs. PARP1KO in Time 4h 0.977777779999997 4.66893463449613 0.209422032335974 0.839353363278407
ALC1KO vs. ALC1KOPARP1KO in Time 4h 2.83333333666666 4.66893463449613 0.606847933944664 0.560775190290894
PARP1KO vs. ALC1KO in Time 4h -0.977777779999997 4.66893463449613 -0.209422032335974 0.839353363278407
PARP1KO vs. WT in Time 4h -12.57777778 4.66893463449613 -2.69392886485706 0.0273297999954633
PARP1KO vs. ALC1KOPARP1KO in Time 4h 1.85555555666667 4.66893463449613 0.397425901608691 0.70144661040122
ALC1KOPARP1KO vs. PARP1KO in Time 4h -1.85555555666667 4.66893463449613 -0.39742590160869 0.70144661040122
ALC1KOPARP1KO vs. ALC1KO in Time 4h -2.83333333666667 4.66893463449613 -0.606847933944665 0.560775190290894
ALC1KOPARP1KO vs. WT in Time 4h -14.4333333366666 4.66893463449613 -3.09135476646575 0.0148590262158682
Estimate Std. Error t value Pr(>|t|)
WT vs. ALC1KO in Time 6h 9.91111111333332 1.68486362374628 5.8824411505164 0.000368983013659883
WT vs. PARP1KO in Time 6h 10.9111111133333 1.68486362374628 6.47596099740853 0.00019293692883471
WT vs. ALC1KOPARP1KO in Time 6h 10.67777778 1.68486362374628 6.3374730331337 0.00022359363409955
ALC1KO vs. WT in Time 6h -9.91111111333332 1.68486362374628 -5.8824411505164 0.000368983013659883
ALC1KO vs. PARP1KO in Time 6h 1 1.68486362374628 0.593519846892123 0.569229811765944
ALC1KO vs. ALC1KOPARP1KO in Time 6h 0.766666666666668 1.68486362374628 0.455031882617294 0.661180785725929
PARP1KO vs. ALC1KO in Time 6h -1 1.68486362374628 -0.593519846892124 0.569229811765943
PARP1KO vs. WT in Time 6h -10.9111111133333 1.68486362374628 -6.47596099740853 0.00019293692883471
PARP1KO vs. ALC1KOPARP1KO in Time 6h -0.233333333333334 1.68486362374628 -0.138487964274829 0.893277321017252
ALC1KOPARP1KO vs. PARP1KO in Time 6h 0.233333333333335 1.68486362374628 0.13848796427483 0.893277321017251
ALC1KOPARP1KO vs. ALC1KO in Time 6h -0.766666666666667 1.68486362374628 -0.455031882617294 0.661180785725929
ALC1KOPARP1KO vs. WT in Time 6h -10.67777778 1.68486362374628 -6.3374730331337 0.000223593634099551
write.table(output, file = "Figure3C_Stats_New_All.txt", quote = F, sep = "\t", row.names = T, col.names = NA)